<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="" content="">
    <meta name="'" content="">
    <title>最新动态</title>
    <style type="text/css">
        *{
            margin: 0px;
            padding: 0px;
        }
        div{
            width: 300px;
            margin: 50px auto;
            background-color: red;
        }
        #text{
            border: none;
            float: left;
            width: 0px;
            height: 30px;
            margin: 5px 10px;
            transition-property: all;
            transition-duration: 1s;
        }
    </style>
</head>
<body>
    <div>
        <input type="text" id='text'>
        <input type="button" name="" value='按钮' onclick="btn()">
    </div>
</body>
<script type="text/javascript">
    var text_onclick=document.getElementById('text');
    function btn() {
        text_onclick.style.width='190px';
    }
</script>
</html>